<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	var base = "${base}/";
</script>
<!--框架必需-->
<script type="text/javascript" src="${base}/scripts/plugins/jquery-1.7.1.js"></script>
<script type="text/javascript" src="${base}/scripts/framework.js"></script>
<link href="${base}/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link href="${base}/css/sky/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function(){
	top.Dialog.close();
})
</script>
</head>
<body>
<div class="position" id="top_list">
	<div class="center">
	<div class="left">
	<div class="right">
		<span>当前位置：资金管理 >> 经销商资金列表</span>
	</div>	
	</div>	
	</div>
</div>
<div id="hbox">
	<div class="bs_nav">
		<div class="bs_navleft">
		    <ul>
		    	<form action="${base}/admin/franchiser/findByKeyWord.action" method="post" target="frmright">
		    	<li><span class="img_find"></span></li>
				<li>
					<select name="searchType">
						<option value="accountType">按账户类别查询</option>
						<option value="accountNo">按账户号码查询</option>
						<option value="owner">按账户所属查询</option>
						<option value="accountStatus">按账户状态查询</option>
					</select>
				</li>
				<li>
					<input type="text" style="width:150px;" name="keyWord" value="${(keyWord)!''}"/>
					<select name="keyWord" style="display:none;" disabled>
						<option value="1">使用中</option>
						<option value="0">不可用</option>
					</select>
				</li>
				<li><input type="submit" class="button" value="查询"/></li>
				</form>
			</ul>
		</div>
		<div class="bs_navright">
			<a onclick="openWinAdd()"><span class="icon_add">新增资金账户</span></a>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
</div>
<div id="scrollContent" class="border_gray">
<table class="tableStyle">
	<tr>
		<th width="10%" class="th-title">账户类别</th>
		<th width="20%" class="th-title">账户号码</th>
		<th width="10%" class="th-title">账户资金</th>
		<th width="15%" class="th-title">账户所属</th>
		<th width="10%" class="th-title">账户状态</th>
		<th width="20%" class="th-title">添加日期</th>
		<th width="15" class="th-title">基本操作</th>
	</tr>
	<#if (franchiserFundList??) && (franchiserFundList?size>0)>
		<#list franchiserFundList as franchiserFund>
			<tr>
				<td>${(franchiserFund.accountType)!''}</td>
				<td>${(franchiserFund.accountNo)!''}</td>
				<td>￥${(franchiserFund.accountBalance)!'0.00' }</td>
				<td>${(franchiserFund.owner)!'' }</td>
				<td>${(franchiserFund.accountStatus)?string('使用中','不可用') }</td>
				<td>${(franchiserFund.createDate?string('yyyy-MM-dd HH:mm:ss'))!''}</td>
				<td>
					<a onclick="openWinShow(${(franchiserFund.id)!0})"><span class="icon_view">查看</span></a>
					<a onclick="openWinFind(${(franchiserFund.id)!0})"><span class="icon_edit">修改</span></a>
					<a href="${base}/admin/franchiser/updateStatus.action?franchiserFund.id=${(franchiserFund.id)!''}">
						<span class="icon_add">
						${((franchiserFund.accountStatus)?string('<a href="${base}/admin/franchiser/updateStatus.action?franchiserFund.id=${(franchiserFund.id)!}&franchiserFund.accountStatus=false">锁定</a>', '<a href="${base}/admin/franchiser/updateStatus.action?franchiserFund.id=${(franchiserFund.id)!}&franchiserFund.accountStatus=true">解锁</a>'))!''}
						</span>
					</a>
				</td>
			</tr>
		</#list>
	<#else>
		<tr>
			<td colspan="9">暂无经销商资金账号记录</td>
		</tr>
	</#if>
</table>
<#include "/WEB-INF/tool/pager.ftl">
</div>
</body>
</html>
<script type="text/javascript">
function openWinAdd(){
	var diag = new top.Dialog();
	diag.Title = "新增经销商资金账户信息";
	diag.URL = "${base}/admin/franchiser/add.action";
	diag.Height=300;
	diag.CancelEvent = function(){
		diag.innerFrame.contentWindow.location.reload();
		diag.close();
	};
	diag.show();
}
function openWinFind(franchiserFundId){
	var diag = new top.Dialog();
	diag.Title = "修改经销商资金账户信息";
	diag.URL = "${base}/admin/franchiser/findById.action?franchiserFund.id=" + franchiserFundId;
	diag.Height=300;
	diag.CancelEvent = function(){
		diag.innerFrame.contentWindow.location.reload();
		diag.close();
	};
	diag.show();
}
function openWinShow(franchiserFundId){
	var diag = new top.Dialog();
	diag.Title = "查看经销商资金账户信息";
	diag.URL = "${base}/admin/franchiser/showById.action?franchiserFund.id=" + franchiserFundId;
	diag.Height=300;
	diag.CancelEvent = function(){
		diag.innerFrame.contentWindow.location.reload();
		diag.close();
	};
	diag.show();
}

$(function() {
	$("select[name='searchType']").change(function() {
		$(this).parent().next().children("input").attr("disabled", false).show();
		$(this).parent().next().children("select").attr("disabled", true).hide();
		if ($(this).val() == "accountStatus") {
			$(this).parent().next().children("input").attr("disabled", true).hide();
			$(this).parent().next().children("select").attr("disabled", false).show();
		}
	});
});
</script>